package demo4_1.controller;

import demo4_1.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class UserController {
    @Autowired
    private IUserService userService;
    public void doLogin(){
        System.out.println("UserController:开始处理登录请求...");
        System.out.println("UserController:接受用户名和密码...");
        String username = "张三";
        String password = "password";

        boolean success = userService.login(username,password);
        if (success){
            System.out.println("UserController:向用户发送登录成功页面");
        }else{
            System.out.println("UserController:向用户发送登陆失败页面");
        }
    }
}
